#include "mallardduck.h"

#include "defaultbehavior.h"

#include <qDebug>

MallardDuck::MallardDuck()
    : m_quackBehavior(new DefaultBehavior())
{
}

void MallardDuck::fly()
{
    // qDebug()<<"I am a mallard duck, I can fly!";
}

void MallardDuck::quack()
{
    if (m_quackBehavior)
    {
        m_quackBehavior->quack();
    }
}

void MallardDuck::setQuackBehavior(QuackBehavior *quackBehavior)
{
    m_quackBehavior = quackBehavior;
}
